package com.wjjun.common.ui.viewmodel

import androidx.databinding.ObservableField
import com.wjjun.base.ui.viewmodel.BaseWindowViewModel

/**
 * 通用的布局viewModel
 * author : wangjunjun
 * date   : 2022/7/20
 * desc   :
 */
class CommonWindowViewModel : BaseWindowViewModel() {

    private var layoutId = 0

    val title = ObservableField<String>()

    val msg = ObservableField<String>()

    val cancelBtn = ObservableField<String>("取消")
    val confirmBtn = ObservableField<String>("确定")

    val data = ObservableField<Any>()

    val state = ObservableField<Any>()

    override fun getLayoutId(): Int {
        return layoutId
    }

    fun setData(data: Any) {
        this.data.set(data)
        this.data.notifyChange()
    }

    fun setState(state: Any) {
        this.state.set(state)
        this.state.notifyChange()
    }

}